<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <!-- 订单信息 -->
    <div class="panel panel-primary">
        <div class="panel-heading">
            <h3 class="panel-title"><i class="fa fa-file-text-o"></i> 订单信息</h3>
        </div>
        <div class="panel-body">
            <div class="row">
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-3">订单编号:</label>
                        <div class="col-xs-12 col-sm-9">
                            <p class="form-control-static">{$row.order.order_no|default='未知'}</p>
                        </div>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-3">订单状态:</label>
                        <div class="col-xs-12 col-sm-9">
                            <p class="form-control-static">
                                {if condition="$row.order.order_status == 1"}
                                    <span class="label label-warning">待处理</span>
                                {elseif condition="$row.order.order_status == 2" /}
                                    <span class="label label-success">同意接收</span>
                                {elseif condition="$row.order.order_status == 3" /}
                                    <span class="label label-danger">拒绝接收</span>
                                {else /}
                                    <span class="label label-default">待处理</span>
                                {/if}
                            </p>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-3">客户名称:</label>
                        <div class="col-xs-12 col-sm-9">
                            <p class="form-control-static">{$row.order.customer_name|default='未知'}</p>
                        </div>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-3">创建时间:</label>
                        <div class="col-xs-12 col-sm-9">
                            <p class="form-control-static">{$row.order.create_time|default='未知'}</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- 工作分配信息 -->
    <div class="panel panel-info">
        <div class="panel-heading">
            <h3 class="panel-title"><i class="fa fa-user-plus"></i> 工作分配信息</h3>
        </div>
        <div class="panel-body">
            <input type="hidden" id="status_mask" value="{$row.offer_status}" />
            
            <div class="row">
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-3">分配职位:</label>
                        <div class="col-xs-12 col-sm-9">
                            <p class="form-control-static">
                                <span class="label label-primary">{$row.position_text}</span>
                            </p>
                        </div>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-3">分配人员:</label>
                        <div class="col-xs-12 col-sm-9">
                            <p class="form-control-static">
                                {if condition="$row.user"}
                                    <span class="label label-info">{$row.user.username}</span>
                                    {if condition="$row.user.nickname"}
                                        <small class="text-muted">({$row.user.nickname})</small>
                                    {/if}
                                {else /}
                                    <span class="label label-default">未分配</span>
                                {/if}
                            </p>
                        </div>
                    </div>
                </div>
            </div>

            {if condition="$row.offer_status>1"}
            <div class="row">
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-3">当前状态:</label>
                        <div class="col-xs-12 col-sm-9">
                            {if condition="$row.offer_status==2"}
                            <span class="label label-success"><i class="fa fa-check"></i> 同意接收</span>
                            {/if}
                            {if condition="$row.offer_status==3"}
                            <span class="label label-danger"><i class="fa fa-times"></i> 拒绝接收</span>
                            {/if}
                        </div>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-3">确认时间:</label>
                        <div class="col-xs-12 col-sm-9">
                            <p class="form-control-static">{$row.confirm_time|default='未确认'}</p>
                        </div>
                    </div>
                </div>
            </div>
            {else /}
            <div class="row">
                <div class="col-md-12">
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-3">审核状态:</label>
                        <div class="col-xs-12 col-sm-9">
                            <div class="radio">
                                {foreach name="jobOfferStatus" item="vo"}
                                {if condition="$key>1"}
                                <label for="row[offer_status]-{$key}" style="margin-right: 20px;">
                                    <input id="row[offer_status]-{$key}" name="row[offer_status]" type="radio"
                                           value="{$key}" {in name="key" value="2" }checked{/in} /> 
                                    <span class="label {if condition="$key==2"}label-success{else /}label-danger{/if}">{$vo}</span>
                                </label>
                                {/if}
                                {/foreach}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            {/if}
        </div>
    </div>
 
    <!-- 审核意见 -->
    <div class="panel panel-success">
        <div class="panel-heading">
            <h3 class="panel-title"><i class="fa fa-comment-o"></i> 审核意见</h3>
        </div>
        <div class="panel-body">
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-3">审核意见:</label>
                <div class="col-xs-12 col-sm-9">
                    <textarea id="c-remark" class="form-control" name="row[remark]" rows="3" 
                              placeholder="请输入审核意见...">{$row.remark|htmlentities}</textarea>
                    <small class="help-block">
                        {if condition="$row.offer_status==1"}
                        请填写审核意见，如果选择"拒绝"，必须填写拒绝原因。
                        {else /}
                        当前审核意见：{$row.remark|default='无'}
                        {/if}
                    </small>
                </div>
            </div>
        </div>
    </div>

    <!-- 操作按钮 -->
    {if condition="$row.offer_status==1"}
    <div class="form-group layer-footer">
        <div class="col-xs-12 text-center">
            <button type="submit" class="btn btn-primary">
                <i class="fa fa-check"></i> 确定
            </button>
            <button type="button" class="btn btn-default" onclick="parent.layer.closeAll();" style="margin-left: 10px;">
                <i class="fa fa-times"></i> 取消
            </button>
        </div>
    </div>
    {else /}
    <div class="form-group layer-footer">
        <div class="col-xs-12 text-center">
            <button type="button" class="btn btn-default" onclick="parent.layer.closeAll();">
                <i class="fa fa-times"></i> 关闭
            </button>
        </div>
    </div>
    {/if}
</form>
<style>
    .dropdown-toggle {
        background: #fff !important;
    }
    
    .layer-footer {
        margin-top: 20px;
        padding-top: 15px;
        border-top: 1px solid #eee;
    }
</style>